package com.example.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity4 extends AppCompatActivity {
private RecyclerView recyclerView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);

        recyclerView=findViewById(R.id.recycle);

//        recyclerView.setAdapter();
        List<Person> personList=new ArrayList<>();
        Person person1=new Person("hhhh","19307132956",R.drawable.abc);
        Person person2=new Person("zkq","21231231312",R.drawable.abc);

        Person person3=new Person("zzz","21233232322",R.drawable.abc);
      personList.add(person1);
      personList.add(person2);
        personList.add(person3);
        LinearLayoutManager layoutManager =new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);

      Adapter adapter =new Adapter(MainActivity4.this,personList);
      recyclerView.setAdapter(adapter);
//        Intent intent=new Intent(MainActivity4.this,MainActivity2.class);
//        ImageView imageView=findViewById(R.id.imageView5);
//        imageView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                startActivity(intent);
//            }
//        });


    }
}